package org.kgc.alanhealth.controller;

import org.kgc.alanhealth.entity.HospitalDoctor;
import org.kgc.alanhealth.entity.HospitalType;
import org.kgc.alanhealth.service.HospitalDoctorService;
import org.kgc.alanhealth.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin(origins = "*")
public class DepartmentDoctorController {
    @Autowired
    private HospitalDoctorService hospitalDoctorService;


    @GetMapping("hospital-doctor")
    public Result getDoctorByTypeId(int id){
        List<HospitalDoctor> list= hospitalDoctorService.getDoctorByTypeId(id);
        if (list!=null&&!list.isEmpty()){
            return Result.success(list);
        }else {
            return Result.error("没有找到数据");
        }
    }
}
